<%@ page language="java"  pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="format-detection" content="telephone=no,email=no,adress=no">
<link href="<%=request.getContextPath()%>/css/global.css" type="text/css" rel="stylesheet" />
<link href="<%=request.getContextPath() %>/js/easyui/themes/metro/easyui.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath() %>/js/date/skin/WdatePicker.css" type="text/css" rel="stylesheet"/>
<link href="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<%=request.getContextPath() %>/js/jquery.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/global.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/easyui/easyui.js"></script>
<script type="text/javascript" src="<%=request.getContextPath() %>/js/date/WdatePicker.js"></script>
<script type="text/javascript" src="<%=request.getContextPath()%>/js/autocomplate/jquery.autocomplete.js"></script>
<script type="text/javascript">

$(function(){
	$('#merNo').autocomplete({
    	serviceUrl: '<%=request.getContextPath()%>/merchant_auto.html',
    	minChars:1,
    	paramName:'merNo',
    	transformResult: function(response) {
		　　return {
		　　　　suggestions: $.map($.parseJSON(response), function(dataItem) {
		　　　　　　return { value: dataItem.merNo, data: dataItem.merName};
		　　　　})
		　　};
		},
    	formatResult:function (suggestion, currentValue) {
    		return "[" + suggestion.value.replace(currentValue,"<strong>"+currentValue+"</strong>")+ "]" + suggestion.data;
    	}
});

});

</script>
</head>
<body >
<div id="dataSearch" >    
<form id="sform" action="form_charge.html" method="get" enctype="multipart/form-data">
<table style="width: 100%;">
<tr><td height="30" >
<s:textfield  id="merNo" name="keyNo" placeholder="商户编号"></s:textfield>
<s:textfield  id="dateTop"  name="dateTop" placeholder="日期起"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="dateTop" format="yyyy-MM-dd"/></s:param></s:textfield>
 - 
<s:textfield  id="dateEnd"  name="dateEnd" placeholder="日期止"  onclick="WdatePicker();"  cssStyle="width:100px;" ><s:param name="value"><s:date name="dateEnd" format="yyyy-MM-dd"/></s:param></s:textfield>
<input type="button" class="submit" value="查询搜索" onclick="sform.submit();"/>
<input type="button" class="submit" value="今天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(0)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="昨天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-1)),'dateEnd',getDate(-1)) "/>
<input type="button" class="submit" value="前天记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-2)),'dateEnd',getDate(-2)) "/>
<input type="button" class="submit" value="最近一周" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-7)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="最近一月" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-30)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="最近一年" onclick="location.href=winUrl(winUrl(location.href,'dateTop',getDate(-365)),'dateEnd',getDate(0)) "/>
<input type="button" class="submit" value="全部记录" onclick="location.href=winUrl(winUrl(location.href,'dateTop','1970-01-01'),'dateEnd',getDate(0)) "/>
</td>
</tr>
<tr><td><hr/></td></tr>
<tr>
	<td>
			</td>
</tr>
</table>
</form>
</div>

<center>
<table width="100%" border="0">
		<tr>
			<td height="30" align="left"  colspan="10" >&nbsp;<b>总笔数 : <s:text name="global.format.count"><s:param value="formMap.txnSummary.txnCount"/></s:text> 笔 总金额 : <s:text name="global.format.number"><s:param value="formMap.txnSummary.txnTotal"/></s:text> 元</b></td>
		</tr>
		<tr>
			<td height="30" align="left" width="20%" colspan="2" >&nbsp;<b>商户编号/名称</b></td>
			<td height="30" align="left" width="20%" colspan="2">&nbsp;<b>成功交易笔数/金额</b></td>
			<td height="30" align="left" width="20%" colspan="2">&nbsp;<b>退款笔数/金额</b></td>
			<td height="30" align="left" width="20%" colspan="2">&nbsp;<b>拒付笔数/金额</b></td>
			<td height="30" align="left" width="20%" colspan="2">&nbsp;<b>冻结笔数/金额</b></td>
		</tr>
		<s:iterator value="formMap.txnList" id="show" status="seq">
		<tr >
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:property value="#show.merNo"/></td>
		<td style="border: 1px solid gray;padding-left: 5px;" height="30" align="left" width="10%"><label  id="merName_<s:property value="#show.merNo"/>"></label>
				<script type="text/javascript">
		 		$("#merName_<s:property value="#show.merNo"/>").load("<%=request.getContextPath()%>/merchant_name.html?merNo=<s:property value="#show.merNo"/>");
		 		</script>
		</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.count"><s:param value="#show.stateCount"/></s:text> 笔</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.number"><s:param value="#show.stateTotal"/></s:text> 元</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.count"><s:param value="#show.refundCount"/></s:text> 笔</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.number"><s:param value="#show.refundTotal"/></s:text> 元</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.count"><s:param value="#show.refuseCount"/></s:text> 笔</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.number"><s:param value="#show.refuseTotal"/></s:text> 元</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.count"><s:param value="#show.freezeCount"/></s:text> 笔</td>
		<td style="border: 1px solid gray;" height="30" align="left" width="10%">&nbsp;<s:text name="global.format.number"><s:param value="#show.freezeTotal"/></s:text> 元</td>
		</tr>
		</s:iterator>
</table>			
</center>

<br/>
<br/>
<br/>
</body>
</html>
